import { defineStore } from 'pinia'

export const useStationStore = defineStore('station', () => {
  let powerStation = ref(typeof localStorage.getItem('powerStation') !='undefined'&&JSON.parse(localStorage.getItem('powerStation') as string) || '');
  const setPowerInfo = (value:any) => {
    powerStation.value = value;
    localStorage.setItem('powerStation', JSON.stringify(value));
  };

  return {
    powerStation,
    setPowerInfo
  };
});

export default useStationStore;